package core.util;

import java.io.IOException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PropertiesUtil {
	private static Logger logger = LoggerFactory.getLogger(PropertiesUtil.class);
	private static Properties prop = new Properties();

	static {
		try {
			prop.load(PropertiesUtil.class.getResourceAsStream("/redis.properties"));
		} catch (IOException e) {
			logger.error(e.getMessage(), e);
			throw new ExceptionInInitializerError(e);
		}
	}
	
	public static String getString(String key) {
		return "" + prop.get(key);
	}
	
	public static boolean getBoolean(String key) {
		return Boolean.valueOf(getString(key));
	}
	
	public static int getInt(String key) {
		return Integer.valueOf(getString(key));
	}
	
	public static long getLong(String key) {
		return Long.valueOf(getString(key));
	}
	
}
